//
// Created by Administrator on 2019/12/06.
//

#ifndef DEMO2_SHAPE_H
#define DEMO2_SHAPE_H


class Shape {
public:
    Shape();
    Shape(int w, int h)
    {
        this->w = w;
        this->h = h;
    }

    virtual int area() = 0;
protected:
    int w, h;
};

class Rectangle : public Shape
{
public:
    Rectangle(int w, int h):Shape(w, h){}
    int area();
};

class Triangle : public Shape
{
public:
    Triangle(int w, int h):Shape(w, h){}
    int area();
};
#endif //DEMO2_SHAPE_H
